package de.mhu.mandalaui.bind;

import java.io.PrintWriter;

import de.mhu.mandalaui.actions.SingleDataSourceAction;
import de.mhu.mandalaui.attributes.Attribute;

public class StaticSingleDataSource extends SingleDataSourceAction {

	private Attribute target;
	
	@Override
	public void renderFunctionImplementation(PrintWriter out) {
		out.println("function(data) {");
		if (target != null) 
			target.renderSet(out, getData(null));
		else
			out.println("// no target set");
		out.println("}");
	}

	public Attribute getTarget() {
		return target;
	}

	public void setTarget(Attribute target) {
		this.target = target;
	}

}
